-- GENERATED SPELL FOR [Ashtongue Mystic] --


function spell0_22845(pUnit, Event) --@Bloodlust,n/a--
pUnit:FullCastSpellOnTarget(41185,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22845', 20289, 1)
end

function spell1_22845(pUnit, Event) --@Chain Heal,Heal--
pUnit:FullCastSpellOnTarget(41114,pUnit)
pUnit:RegisterEvent('Sorts_22845', 2500, 1)
end

function spell2_22845(pUnit, Event) --@Cyclone Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(39589,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_22845', 1, 1)
end

function spell3_22845(pUnit, Event) --@Flame Shock,n/a--
pUnit:FullCastSpellOnTarget(41115,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22845', 12000, 1)
end

function spell4_22845(pUnit, Event) --@Frost Shock,n/a--
pUnit:FullCastSpellOnTarget(41116,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22845', 8341, 1)
end

function spell5_22845(pUnit, Event) --@Searing Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(39588,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_22845', 1, 1)
end

function spell6_22845(pUnit, Event) --@Summon Windfury Totem,Self--
pUnit:FullCastSpellOnTarget(39586,pUnit)
pUnit:RegisterEvent('Sorts_22845', 652, 1)
end

function Sorts_22845(pUnit, Event)
local choix_sorts_22845 = math.random(0, 6)
if choix_sorts_22845 == 0 then
pUnit:RegisterEvent('spell0_22845', 1, 1)
end
if choix_sorts_22845 == 1 then
pUnit:RegisterEvent('spell1_22845', 1, 1)
end
if choix_sorts_22845 == 2 then
pUnit:RegisterEvent('spell2_22845', 1, 1)
end
if choix_sorts_22845 == 3 then
pUnit:RegisterEvent('spell3_22845', 1, 1)
end
if choix_sorts_22845 == 4 then
pUnit:RegisterEvent('spell4_22845', 1, 1)
end
if choix_sorts_22845 == 5 then
pUnit:RegisterEvent('spell5_22845', 1, 1)
end
if choix_sorts_22845 == 6 then
pUnit:RegisterEvent('spell6_22845', 1, 1)
end
end

function mob22845_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22845', math.random(1500, 3000), 1)
end

function mob22845_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22845_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22845_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22845, 1, 'mob22845_Action')
RegisterUnitEvent(22845, 2, 'mob22845_Leave')
RegisterUnitEvent(22845, 3, 'mob22845_Kill')
RegisterUnitEvent(22845, 4, 'mob22845_Die')
